import wx


class MyFrame(wx.Frame):

    def __init__(self, parent, id):
        super().__init__(parent, id, 'Frame With Button', size=(300, 100))

        self.panel = wx.Panel(self, -1)
        self.button = wx.Button(self.panel, -1, 'Not Over', pos=(100, 15))

        self.Bind(wx.EVT_BUTTON, self.OnButtonClick, self.button)
        self.button.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown)

    def OnButtonClick(self, event):
        print("OnButtonClick")
        self.panel.SetBackgroundColour("Green")
        self.panel.Refresh()
        # self.Destroy()

    def OnMouseDown(self, event):
        print("OnMouseDown")
        self.button.SetLabel("Again!")
        event.Skip()


if __name__ == '__main__':
    app = wx.App()

    frame = MyFrame(None, -1)
    frame.Show(True)

    app.MainLoop()
